<?php

return [
    'type' => env('SERVER_TYPE', 'websocket'), // http|websocket|tcp

    'event_handler' => [
        'websocket' => App\Servers\WebSocket\EventHandler::class,
        'http' => App\Servers\Http\EventHandler::class,
        'tcp' => App\Servers\Tcp\EventHandler::class,
        'udp' => App\Servers\Udp\EventHandler::class
    ],
    'host' => env('SERVER_HOST', '0.0.0.0'),
    'port' => env('SERVER_PORT', 9501),
    'settings' => [
        'reactor_num' => swoole_cpu_num() * 2,
        'worker_num' => swoole_cpu_num() * 4,
        'task_worker_num' => swoole_cpu_num() * 2,
        'enable_coroutine' => true,
        'max_request' => 10000,
        'reload_async' => true
    ],
    'workers' => (int) env('SERVER_WORKERS', swoole_cpu_num()),
    'protocols' => [
        'http' => true,
        'websocket' => true
    ],
];
